import json

import requests as rq
import logging as log
import time


interval = 72
while True:
    print("current interval is {}".format(interval))
    time.sleep(interval)
    interval = interval + 1
    cookies = dict(
        ironman='.eJwtzj0OwjAMQOG7ZGbwX-Kkl6ni2BasLZ0Qd6cD25Pe8n3Knkecz7K9jyseZX952QqqkSnTMllESNoaiJAaeOZy0aDeOHIqeM27Vq0ANtDSpivQyDkqNJFIkdH7ItXpTI0bqOIQZ_QFUJcjrOwWiDU57sVjcrkh1xnHX1O-P4FOLmk.XwQi0w.tF7CaXUKnTOSjwbpoQ1GZmdzpu8')
    content = rq.get("http://localhost:8000/api/security/currentUser", cookies=cookies).text
    j = json.loads(content)
    print("content is {}".format(content))
    code = j.get("code")
    if code and int(code) == 500:
        print("interval {} failed".format(interval))
        break

import os

path = "/Users/lifeng/Desktop/12/"
files = os.listdir(path)
for f in files:
    j = open(path+f)
    o = json.loads(json.load(j))
    # dt = o.get("dateTime")
    name = o.get("tagName")
    print(name)